package com.aiwiown.face.request;

import com.aiwiown.face.ApiMethod;
import com.aiwiown.face.ApiObject;
import com.aiwiown.face.ApiRequest;
import com.aiwiown.face.internal.util.RequestParamUtils;
import com.aiwiown.face.response.PcResultResponse;

import java.util.Map;

/**
 * <pre>
 *
 * 此接口提供活体结果反查功能，可以以biz_id为索引对网页端活体检测及比对结果进行反查。
 *
 * 注：该接口的数据存储有效期为一天，且仅第一次调用有效。第二次或超过有效期调用则会返回错误信息，建议在每笔业务结束之后及时的取回数据。
 * https://faceid.com/pages/documents/5680508
 * </pre>
 * PcResultRequest
 * Date: 2020/5/12 0012
 * Time: 10:08
 *
 * @author tang.xiaosheng@qq.com
 */
public class PcResultRequest implements ApiRequest<PcResultResponse> {

    private String apiVersion = "v2";
    private static String apiUrl = "/get_result";

    private String bizContent;
    private ApiObject bizModel = null;


    @Override
    public ApiMethod getApiMethod() {
        return ApiMethod.GET;
    }

    @Override
    public String getApiUrl() {
        return "/liveness/" + this.apiVersion + apiUrl;
    }

    @Override
    public Map<String, String> getTextParams() throws IllegalAccessException {
        return RequestParamUtils.getTextParams(this.bizModel);
    }

    @Override
    public Map<String, byte[]> getByteArrayParams() throws IllegalAccessException {
        return RequestParamUtils.getByteArrayParams(this.bizModel);
    }

    @Override
    public String getApiVersion() {
        return null;
    }

    @Override
    public Class<PcResultResponse> getResponseClass() {
        return PcResultResponse.class;
    }

    @Override
    public String getBizContent() {
        return this.bizContent;
    }

    public void setBizModel(ApiObject bizModel) {
        this.bizModel = bizModel;
    }

    @Override
    public String signVersion() {
        return null;
    }

    @Override
    public String getSignInfo(String apiKey, String secretKey) throws Exception {
        return null;
    }
}
